package com.yunshipei.ui.fragment;


import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;

import com.yunshipei.ui.activity.AlarmSetActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment extends Fragment {
    public Handler handler = null;
    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        ((AlarmSetActivity)activity).setOnInfomationSaveListener(new AlarmSetActivity.OnInfomationSaveListener() {
            @Override
            public void onInfomationSave() {
                //do something
                handlerSendMessage();
            }
        });
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        handler = ((AlarmSetActivity) getActivity()).handler;
    }



    public BaseFragment() {
        // Required empty public constructor
    }

    abstract void handlerSendMessage();


}
